//1 path.join 的使用
const fs =require("fs")
const path = require("path")
fs.readFile(__dirname+"/files/1.txt","utf8",function(err,dataStr){
    console.log(dataStr);
})
fs.readFile(path.join(__dirname,"./files/01.txt"),"utf8",function(err,dataStr){
    console.log(dataStr);
})

//2 path.basename() 获取文件名
const pathJion = "./a/b/c/index.html"
let str = path.basename(pathJion)
console.log(str);
let Str = path.basename(pathJion,".html")
console.log(Str);

//3 path.extname() 获取文件扩展名

let ext = path.extname(pathJion)
console.log(ext);
